Skip to content

#135 - 익명 프로필 조회 기능을 구현합니다. #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 4, 2025

Conversation

kpeel5839
Copy link
Contributor

1. 🔗 관련 이슈

closes #135

2. 📄 구현한 내용 또는 수정한 내용

  • 익명 프로필 조회 기능을 구현했습니다.

5. ✅ 배포 Checklist

  • 본인을 Assign 해주세요.
  • 본인을 제외한 백엔드 개발자를 리뷰어로 지정해주세요.
  • 변경된 DB 업데이트 해주세요. (꼭 해주세요 배포 안돼요!!!)

@kpeel5839 kpeel5839 added 🌱기능🌱 새로운 기능을 추가해요 ! 🏋️매튜🏋️ 24기 김재연 labels May 4, 2025
@kpeel5839 kpeel5839 requested a review from Copilot May 4, 2025 12:44
@kpeel5839 kpeel5839 self-assigned this May 4, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the anonymous profile viewing feature and related endpoints. Key changes include:

  • Adding query methods and persistence support for anonymous message rooms.
  • Enhancing domain models (User, UserProfile, MessageV2, etc.) to support anonymous profile logic.
  • Introducing new API endpoints/controllers and a service for retrieving anonymous profiles.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
infrastructure/mysql/src/main/kotlin/com/wespot/message/v2/MessageV2PersistenceAdapter.kt Introduces a new repository method to fetch message rooms by sender and receiver IDs.
infrastructure/mysql/src/main/kotlin/com/wespot/message/v2/MessageV2JpaRepository.kt Adds a query to fetch messages with a null messageRoomId filtered by sender and receiver.
domain/src/main/kotlin/com/wespot/user/User.kt Overrides equals and hashCode to compare User instances based solely on id.
domain/src/main/kotlin/com/wespot/message/v2/UserProfiles.kt Implements logic to filter and sort anonymous profiles with error handling.
domain/src/main/kotlin/com/wespot/message/v2/UserProfile.kt Creates a UserProfile with support for anonymous profiles using a custom null check.
domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt Adds methods to compare user and anonymous profiles.
domain/src/main/kotlin/com/wespot/message/v2/MessageRooms.kt Adds a viewer() method that ensures there is exactly one viewer in the message rooms.
domain/src/main/kotlin/com/wespot/message/v2/MessageRoom.kt Adds helper methods to check answer eligibility and anonymous profile associations.
domain/src/main/kotlin/com/wespot/message/v2/MessageDetails.kt Adds a method to determine if any message in the details is answerable.
core/src/main/kotlin/com/wespot/message/service/v2/GetAnonymousProfileService.kt Implements the service to fetch anonymous profiles for a receiver.
app/src/main/kotlin/com/wespot/user/CreatedAnonymousProfileController.kt & app/src/main/kotlin/com/wespot/message/v2/GetAnonymousProfileController.kt Updates/restructures API routing for anonymous profile creation and retrieval.
Comments suppressed due to low confidence (2)

domain/src/main/kotlin/com/wespot/user/User.kt:304

  • [nitpick] Overriding equals and hashCode in this data class to compare only the id deviates from the default behavior; consider adding a clarifying comment on why only the id is used to define equality.
override fun equals(other: Any?): Boolean { ... }

app/src/main/kotlin/com/wespot/user/CreatedAnonymousProfileController.kt:12

  • [nitpick] The renaming to 'CreatedAnonymousProfileController' may lead to confusion about this controller's responsibility; consider aligning the name with its functionality regarding anonymous profile creation.
class CreatedAnonymousProfileController(

@@ -36,4 +36,8 @@ data class MessageDetails(
return messages
}

fun isAbleToAnswer():Boolean{
return messages.any { it.isAbleToAnswer }
Copy link
Preview

Copilot AI May 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method isAbleToAnswer appears to be a function and should be invoked (e.g., it.isAbleToAnswer()) rather than referenced as a property.

Suggested change
return messages.any { it.isAbleToAnswer }
return messages.any { it.isAbleToAnswer() }

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope i don't want

}

fun recentlyTalk(): LocalDateTime? {
if (messageRoom == EMPTY_MESSAGE_ROOM) {
Copy link
Preview

Copilot AI May 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Using an EMPTY_MESSAGE_ROOM constant set to null adds an extra layer of indirection; consider checking messageRoom directly for null to improve clarity.

Suggested change
if (messageRoom == EMPTY_MESSAGE_ROOM) {
if (messageRoom == null) {

Copilot uses AI. Check for mistakes.

@kpeel5839 kpeel5839 merged commit c6e6c99 into develop May 4, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱기능🌱 새로운 기능을 추가해요 ! 🏋️매튜🏋️ 24기 김재연
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature]: 쪽지 익명 프로필 목록을 조회합니다.
1 participant